package com.ruoyi.community.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.community.mapper.HeartElderlyInfoMapper;
import com.ruoyi.community.domain.HeartElderlyInfo;
import com.ruoyi.community.service.IHeartElderlyInfoService;

/**
 * 老人信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-07-30
 */
@Service
public class HeartElderlyInfoServiceImpl implements IHeartElderlyInfoService 
{
    @Autowired
    private HeartElderlyInfoMapper heartElderlyInfoMapper;

    /**
     * 查询老人信息
     * 
     * @param elderlyid 老人信息ID
     * @return 老人信息
     */
    @Override
    public HeartElderlyInfo selectHeartElderlyInfoById(Long elderlyid)
    {
        return heartElderlyInfoMapper.selectHeartElderlyInfoById(elderlyid);
    }

    /**
     * 查询老人信息列表
     * 
     * @param heartElderlyInfo 老人信息
     * @return 老人信息
     */
    @Override
    public List<HeartElderlyInfo> selectHeartElderlyInfoList(HeartElderlyInfo heartElderlyInfo)
    {
        return heartElderlyInfoMapper.selectHeartElderlyInfoList(heartElderlyInfo);
    }

    /**
     * 新增老人信息
     * 
     * @param heartElderlyInfo 老人信息
     * @return 结果
     */
    @Override
    public int insertHeartElderlyInfo(HeartElderlyInfo heartElderlyInfo)
    {
        return heartElderlyInfoMapper.insertHeartElderlyInfo(heartElderlyInfo);
    }

    /**
     * 修改老人信息
     * 
     * @param heartElderlyInfo 老人信息
     * @return 结果
     */
    @Override
    public int updateHeartElderlyInfo(HeartElderlyInfo heartElderlyInfo)
    {
        return heartElderlyInfoMapper.updateHeartElderlyInfo(heartElderlyInfo);
    }

    /**
     * 批量删除老人信息
     * 
     * @param elderlyids 需要删除的老人信息ID
     * @return 结果
     */
    @Override
    public int deleteHeartElderlyInfoByIds(Long[] elderlyids)
    {
        return heartElderlyInfoMapper.deleteHeartElderlyInfoByIds(elderlyids);
    }

    /**
     * 删除老人信息信息
     * 
     * @param elderlyid 老人信息ID
     * @return 结果
     */
    @Override
    public int deleteHeartElderlyInfoById(Long elderlyid)
    {
        return heartElderlyInfoMapper.deleteHeartElderlyInfoById(elderlyid);
    }
    @Override
    public int countElderlyAge60and65(){
        return heartElderlyInfoMapper.countElderlyAge60and65();
    }
    @Override
    public int countElderlyAge66and70(){
        return heartElderlyInfoMapper.countElderlyAge66and70();
    }
    @Override
    public int countElderlyAge71and75() {
        return heartElderlyInfoMapper.countElderlyAge71and75();
    }
    @Override
    public int countElderlyAge76and80(){
        return heartElderlyInfoMapper.countElderlyAge76and80();
    }
    @Override
    public int countElderlyAge81and85() {
        return heartElderlyInfoMapper.countElderlyAge81and85();
    }
    @Override
    public int countElderlyAgeUp86(){
        return heartElderlyInfoMapper.countElderlyAgeUp86();
    }
    @Override
    public int countElderlyWoman(){
        return heartElderlyInfoMapper.countElderlyWoman();
    }
    @Override
    public int countElderlyMan(){
        return heartElderlyInfoMapper.countElderlyMan();
    }
}
